package simultaneously.base;

import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * Created by 焕滨 on 2016/3/12.
 */
public class CachedThreadPool {
    public static void main(String[] args){
        ExecutorService exec = Executors.newCachedThreadPool();
        for(int i = 0;i<5;i++)
            exec.execute(new LiftOff());
        //shutdown的调用，可以防止新任务的提交
        exec.shutdown();
    }
}
